package com.aqie.appletserver.service;

import com.aqie.appletserver.bean.request.NewsRequest;
import com.aqie.appletserver.bean.request.SearchNewsRequest;
import com.aqie.appletserver.bean.request.VoiceRequest;
import com.aqie.appletserver.bean.request.WordRequest;
import com.aqie.appletserver.bean.response.*;

import java.io.IOException;

/**
 * https://ai.baidu.com/ai-doc/IMAGERECOGNITION/rk3bcxg71
 */
public interface IBaiduApiService {

    // 文本审核
    TextCensorResponse textCensor(String text);

    // 文本纠错
    TextCorrectionResponse textCorrect(String text);

    // 新闻摘要
    CommonTextResponse newsSummery(NewsRequest request);


    // 语音转文本极速版
    VoiceResponse speechToText(VoiceRequest request, String token) throws IOException;

    // 果蔬识别
    FruitVegetablesResponse identifyFruitsAndVegetables(String filePath) throws IOException;

    // 通用物体和场景识别 CommonObjectAndSceneRecognition
    CommonPictureResponse commonObjectAndSceneRecognition(String filePath) throws Exception;

    CommonPictureResponse commonObjectAndSceneRecognition2(String filePath) throws Exception;

    SearchNewsResponse searchNews(SearchNewsRequest request);


    /**
     * 人物动漫化
     * @param filePath 本地图片完整路径 接口地址
     * @return 处理后图片路径
     * @throws Exception
     */
    PictureResponse handleImage(String filePath, String apiUrl) throws Exception;

    // 通用票据识别
    ReceiptResponse receipt(String filePath) throws IOException;

    // 红酒识别
    WineResponse wine(String filePath) throws IOException;

    // 食物识别
    FoodResponse food(String filePath) throws IOException;

    // 通用文字识别
    WordResponse word(String apiUrl, WordRequest request, String filePath) throws IOException;
}
